package com.wiscamp.ninechapters.problems.domain.models.problems.problems;

import com.wiscamp.ninechapters.problems.domain.models.problems.questions.Question;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Objects;

/**
 * 简单题
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class SimpleProblem extends Problem {

    private Question question;


    public SimpleProblem() {
        this.hasMultipleQuestions = false;
    }

    @Override
    public boolean validate() {
        return !Objects.isNull(question);
    }

    @Override
    public void setCurrentQuestion(@NotNull Question question) {
        this.question = question;
    }

    @Override
    public Question getCurrentQuestion() {
        return this.question;
    }
}
